<?php
// index.php
require __DIR__ . '/vendor/autoload.php';

$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$result= $dotenv->load();
// 允许所有域名跨域请求
header("Access-Control-Allow-Origin: *");
// 允许的请求方法
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
// 允许的请求头
header("Access-Control-Allow-Headers: Content-Type, Authorization");
// 处理 OPTIONS 请求
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
    http_response_code(200);
    exit;
}
if(version_compare(PHP_VERSION,'5.3.0','<'))  die('require PHP > 5.3.0 !');
if (ini_get('magic_quotes_gpc')) {
	function stripslashesRecursive(array $array){
		foreach ($array as $k => $v) {
			if (is_string($v)){
				$array[$k] = stripslashes($v);
			} else if (is_array($v)){
				$array[$k] = stripslashesRecursive($v);
			}
		}
		return $array;
	}
	$_GET = stripslashesRecursive($_GET);
	$_POST = stripslashesRecursive($_POST);
}
define('BIND_MODULE','Api');
define("APP_DEBUG", true);
define('SITE_PATH', dirname(__FILE__)."/");
define('APP_PATH', SITE_PATH . 'Application/');
define('FRAMEWORK_PATH',   SITE_PATH.'Framework/');
define('RUNTIME_PATH',   SITE_PATH.'Runtime/');
//文件存储目录路径
define('STORAGE_PATH',   SITE_PATH.'Storage/');
require FRAMEWORK_PATH.'Core/ThinkPHP.php';
